home *** CD-ROM | disk | FTP | other *** search
- Path: news.umbc.edu!not-for-mail
- From: schlein@umbc.edu (Jonas J. Schlein)
- Newsgroups: comp.lang.c
- Subject: Re: Want function of strmp with wild characters
- Date: 30 Jan 1996 17:44:50 -0500
- Organization: University of Maryland Baltimore County
- Message-ID: <4em712$aed@rpc40.gl.umbc.edu>
- References: <1996Jan30.213213.16764@schbbs.mot.com>
- NNTP-Posting-Host: rpc40.gl.umbc.edu
- NNTP-Posting-User: schlein
-
- Ashok Patil <ashokp@mmsilcc.NoSubdomain.NoDomain> wrote:
- |> I need a function that compares two strings with
- |> wild cards. like one string is "Hello" and another is
- |> is "Helo*". The comparison of these two should return
- |> 0. And if it works for ? that would be great.
-
- Such a function is not a part of the ANSI C language. However, if
- something as simple as the first n characters of a word need to
- compare then I'd use strncmp() which is an ANSI C function located
- in <string.h>. For more complicated matching there are add on
- libraries for regular expression matching which I have seen floating
- around the net. I have not used them personally so please don't
- ask me where to get 'em.
- --
- "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
-
- Jonas J. Schlein (schlein@gl.umbc.edu)
-